home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / hacklist / 94-04.Z / 94-04 / 000012_rcq@mailserv-D.ftp.com_Sat Apr 9 13:34:59 1994.msg < prev    next >
Internet Message Format  |  1994-04-30  |  2KB

  1. Received: from ftp.com (wd40.ftp.com) by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AA18482; Sat, 9 Apr 1994 17:35:55 -0400
  3. Received: from ftp.com by ftp.com  ; Sat, 9 Apr 1994 17:35:54 -0400
  4. Received: from mailserv-D.ftp.com by ftp.com  ; Sat, 9 Apr 1994 17:35:54 -0400
  5. Received: from rcq.hurricane.ftp.com by mailserv-D.ftp.com (5.0/SMI-SVR4)
  6.     id AA21637; Sat, 9 Apr 94 17:34:59 EDT
  7. Date: Sat, 9 Apr 94 17:34:59 EDT
  8. Message-Id: <9404092134.AA21637@mailserv-D.ftp.com>
  9. To: Bruce@isi.FrontierTech.COM
  10. Subject: Re: Curious behaviour from winsock
  11. From: rcq@ftp.com  (Bob Quinn)
  12. Reply-To: rcq@ftp.com
  13. Cc: Multiple recipients of list <winsock-hackers@sunsite.unc.edu>
  14. Sender: rcq@mailserv-D.ftp.com
  15. Repository: mailserv-D.ftp.com, [message accepted at Sat Apr  9 17:34:55 1994]
  16. Originating-Client: hurricane.ftp.com
  17. Content-Length: 1571
  18.  
  19. >   icode@teleport.com (Mark Clouden) writes:
  20. >  >When using non blocking sockets with lingering enabled (l_onoff=1, 
  21. >  >l_linger!=0), I call closesocket and get WSAEWOULDBLOCK back. Now great,
  22. >  >I expected that, but where is my notification message when it does
  23. >  >close?? Or actually, when will it close? - because according to my
  24. >  >network monitor app the socket is still connected.
  25. >  
  26. >  I don't know about the second problem (the connection not actually
  27. >  closing), but I wouldn't expect you would get any more notifications on a
  28. >  socket after you closesocket it, since the socket descriptor is then
  29. >  invalidated.  If you want full graceful shutdown and notifications along
  30. >  the way, I would suggest shutting down for writing to close your end, and
  31. >  reading 'til "end-of-file" to detect the other side's close.
  32.  
  33. I agree with your suggested method for the most robust way to
  34. close a socket; that's what we recommend also.  But it's certainly 
  35. reasonable to call closesocket() and expect an FD_CLOSE when the 
  36. graceful close completes (e.g. FIN response received, so TIME_WAIT
  37. state entered) or the graceful close attempt times out.
  38.  
  39. For example, assuming your application initiated the close (called
  40. closesocket() first), then you'd be in FIN_WAIT.  On page 91 in the
  41. documentation for WSAAsyncSelect() the spec says "The FD_CLOSE is
  42. posted when the connection goes into FIN_WAIT or CLOSE_WAIT states."
  43.  
  44. Regards,
  45. --
  46.  Bob Quinn                                             rcq@ftp.com
  47.  FTP Software, Inc.                                No. Andover, MA